<% if Task.where(:feed_id => feed).overdue.waiting.mine.any? %>
  <h5 class='overdue'>
    逾期
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).overdue.waiting.mine} %>
  <div class='clear'></div>
<% end %>

<%if Task.where(:feed_id => feed).today.waiting.mine.any? %>
  <h5>
    今天
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).today.waiting.mine} %>
  <div class='clear'></div>
<% end %>

<% if Task.where(:feed_id => feed).tomorrow.waiting.mine.any? %>
  <h5>
    明天
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).tomorrow.waiting.mine} %>
  <div class='clear'></div>
<% end %>

<% if Task.where(:feed_id => feed).this_week.mine.any? %>
  <h5>
    本周
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).this_week.mine} %>
  <div class='clear'></div>
<% end %>
<% if Task.where(:feed_id => feed).next_week.waiting.mine.any? %>
  <h5>
    下周
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).next_week.waiting.mine} %>
  <div class='clear'></div>
<% end %>
<% if Task.where(:feed_id => feed).this_month.waiting.mine.any? %>
  <h5>
    本月
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).this_month.waiting.mine} %>
  <div class='clear'></div>
<% end %>

<% if Task.where(:feed_id => feed).later.waiting.mine.any? %>
  <h5>
    随后
  </h5>
  <%= render :partial => 'orders/tasks/detail_in_index.html', :locals => {:tasks => Task.where(:feed_id => feed).later.waiting.mine} %>
  <div class='clear'></div>
<% end %>
<% if Task.where(:feed_id => feed).mine.any? %>
<div class='new_task'>
  <%= link_to '增加一项任务',new_task_order_url(feed), :remote => true, :method => :get, :title => '增加一项与该预定项相关联的任务', :class => :i %>关联该预订项
</div>
<% end %>